#ifndef SEMAPHORE_H
#define SEMAPHORE_H

#include "tools/list.h"

typedef struct _semaphore_t {
    int count;
    list_t wait_list;
} semaphore_t;

void semaphore_init(semaphore_t *p_sem, int init_count);
void semaphore_wait(semaphore_t *p_sem);
void semaphore_notify(semaphore_t *p_sem);
int semaphore_count(semaphore_t *p_sem);

#endif